//
//  ViewController.m
//  UI_frameAndbounds
//
//  Created by dllo on 16/6/4.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
//替换调用.
#define kFrameNSlog(view)NSLog(@"viewframe::x:%lf y: %lf,w:%lf,h : %lf",view.frame.origin.x,view.frame.origin.y,view.frame.size.width,view.frame.size.height);




@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blackColor];
    [self createSubViews];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)createSubViews{
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(100, 100, 200, 200)];
    view.backgroundColor = [UIColor greenColor];
    [self.view addSubview:view];
    [view release];
    
    
    UIView *view2= [[UIView alloc]initWithFrame:CGRectMake(50, 50, 100, 80)];
    view2.backgroundColor = [UIColor redColor];
    [view addSubview:view2];
    [view2 release];
    
    NSLog(@"view bounds:x :%lf,Y:%lf,w:%lf,h: %lf",view.bounds.origin.x,view.bounds.origin.y,view.bounds.size.width,view.bounds.size.height);
//    改变view的bounds的origin,改变了它的子视图位置.
    view.bounds = CGRectMake(120, 1110, 250, 500);
//    影响view的bounds的size,改变了它自身在父视图的位置,影响到了他的frame.
    view.bounds = CGRectMake(00, 0, 200, 200);
    kFrameNSlog(view);
    
}
@end
